package com.shoppingmall.service.impl;

import com.shoppingmall.mapper.CarMapper;
import com.shoppingmall.model.Car;
import com.shoppingmall.model.view.CarView;
import com.shoppingmall.service.CarService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class CarServiceImpl implements CarService {
    @Autowired
private CarMapper carMapper;
    @Override
    public void addCar(Car car) {
        carMapper.addCar(car);
    }

    @Override
    public List<CarView> getCarInfo(int user_id) {
        return carMapper.getCarInfo(user_id);
    }

    @Override
    public void delCar(Car car) {
        carMapper.delCar(car);
    }

    @Override
    public int getUserCarCount(int user_id) {
        return carMapper.getUserCarCount(user_id).size();
    }

    @Override
    public Object getCarCount(Car car) {
        return carMapper.getCarCount(car);
    }

    @Override
    public void updateCarCount(Car car) {
        carMapper.updateCarCount(car);
    }


}
